#version 450

layout(location=0) in vec3 v_Normal;
layout(location=1) in vec3 v_ViewVec;
layout(location=2) in float v_LodBias;
layout(location=3) in float v_SkyBoxIndex;

layout(binding=1) uniform samplerCubeArray u_texture;

layout(location=0) out vec4 fragColor;

void main() {
    float refractRatio = 1.0 / 1.52;
    vec3 N = normalize(v_Normal);
    vec3 V = normalize(v_ViewVec);
    vec3 R = reflect(V, N);
    fragColor = textureLod(u_texture, vec4(R, v_SkyBoxIndex), v_LodBias);
}